package cn.stylefeng.guns.modular.actualClineInformation.controller;

import cn.stylefeng.guns.modular.actualClineInformation.entity.QyuanPowerSdClineActual;
import cn.stylefeng.guns.modular.actualClineInformation.pojo.request.QyuanPowerSdClineActualRequest;
import cn.stylefeng.guns.modular.actualClineInformation.service.QyuanPowerSdClineActualService;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 电网联络线实际信息表，记录每天96个时间点的电网运行预测数据控制器
 *
 * @author 我是谭先生🐻
 * @date 2025/03/14 13:47
 */
@RestController
@ApiResource(name = "电网联络线实际信息表，记录每天96个时间点的电网运行预测数据")
public class QyuanPowerSdClineActualController {

    @Resource
    private QyuanPowerSdClineActualService qyuanPowerSdClineActualService;

    /**
     * 添加
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 13:47
     */
    @PostResource(name = "添加", path = "/qyuanPowerSdClineActual/add")
    public ResponseData<QyuanPowerSdClineActual> add(@RequestBody @Validated(QyuanPowerSdClineActualRequest.add.class) QyuanPowerSdClineActualRequest qyuanPowerSdClineActualRequest) {
        qyuanPowerSdClineActualService.add(qyuanPowerSdClineActualRequest);
        return new SuccessResponseData<>();
    }

    /**
     * 删除
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 13:47
     */
    @PostResource(name = "删除", path = "/qyuanPowerSdClineActual/delete")
    public ResponseData<?> delete(@RequestBody @Validated(QyuanPowerSdClineActualRequest.delete.class) QyuanPowerSdClineActualRequest qyuanPowerSdClineActualRequest) {
        qyuanPowerSdClineActualService.del(qyuanPowerSdClineActualRequest);
        return new SuccessResponseData<>();
    }

    /**
     * 编辑
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 13:47
     */
    @PostResource(name = "编辑", path = "/qyuanPowerSdClineActual/edit")
    public ResponseData<?> edit(@RequestBody @Validated(QyuanPowerSdClineActualRequest.edit.class) QyuanPowerSdClineActualRequest qyuanPowerSdClineActualRequest) {
        qyuanPowerSdClineActualService.edit(qyuanPowerSdClineActualRequest);
        return new SuccessResponseData<>();
    }

    /**
     * 查看详情
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 13:47
     */
    @GetResource(name = "查看详情", path = "/qyuanPowerSdClineActual/detail")
    public ResponseData<QyuanPowerSdClineActual> detail(@Validated(QyuanPowerSdClineActualRequest.detail.class) QyuanPowerSdClineActualRequest qyuanPowerSdClineActualRequest) {
        return new SuccessResponseData<>(qyuanPowerSdClineActualService.detail(qyuanPowerSdClineActualRequest));
    }

    /**
     * 获取列表
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 13:47
     */
    @GetResource(name = "获取列表", path = "/qyuanPowerSdClineActual/list")
    public ResponseData<List<QyuanPowerSdClineActual>> list(QyuanPowerSdClineActualRequest qyuanPowerSdClineActualRequest) {
        return new SuccessResponseData<>(qyuanPowerSdClineActualService.findList(qyuanPowerSdClineActualRequest));
    }

    /**
     * 获取列表（带分页）
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 13:47
     */
    @GetResource(name = "分页查询", path = "/qyuanPowerSdClineActual/page")
    public ResponseData<PageResult<QyuanPowerSdClineActual>> page(QyuanPowerSdClineActualRequest qyuanPowerSdClineActualRequest) {
        return new SuccessResponseData<>(qyuanPowerSdClineActualService.findPage(qyuanPowerSdClineActualRequest));
    }

}
